

namespace Stee.CAP8.MessageBus.Interfaces.Delegates
{
    using System;
    using Stee.CAP8.MessageBus.Interfaces.Models;


    #region Publish

    /// <summary>
    /// Handler for outgoing message publish outcome
    /// </summary>
    /// <param name="publishOutcome">Published outcome</param>
    /// <returns>Return TRUE if published outcome is handled successfully else FALSE</returns>
    public delegate bool HandlePublishResponse(PublishOutcome publishOutcome);

    #endregion Publish


    #region Subscribe

    /// <summary>
    /// Handler for incoming message from subscribed topic
    /// </summary>
    /// <typeparam name="T">Message data type</typeparam>
    /// <param name="topic">Message topic</param>
    /// <param name="eventMessage">Consumed message</param>
    /// <param name="publishUtcDT">Publish date time</param>
    /// <returns>Return TRUE if the incoming message was consumed successfully else FALSE</returns>
    public delegate bool HandleSubscribe<in T>(TopicName topic, T message, DateTime publishUtcDT);

    #endregion Subscribe
}
